package com.ruoyi.project.system.question.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.question.mapper.ExamDetailMapper;
import com.ruoyi.project.system.question.domain.ExamDetail;
import com.ruoyi.project.system.question.service.IExamDetailService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 答题详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-15
 */
@Service
public class ExamDetailServiceImpl implements IExamDetailService 
{
    @Autowired
    private ExamDetailMapper examDetailMapper;

    /**
     * 查询答题详情
     * 
     * @param id 答题详情主键
     * @return 答题详情
     */
    @Override
    public ExamDetail selectExamDetailById(Long id)
    {
        return examDetailMapper.selectExamDetailById(id);
    }

    /**
     * 查询答题详情列表
     * 
     * @param examDetail 答题详情
     * @return 答题详情
     */
    @Override
    public List<ExamDetail> selectExamDetailList(ExamDetail examDetail)
    {
        return examDetailMapper.selectExamDetailList(examDetail);
    }

    /**
     * 新增答题详情
     * 
     * @param examDetail 答题详情
     * @return 结果
     */
    @Override
    public int insertExamDetail(ExamDetail examDetail)
    {
        examDetail.setCreateTime(DateUtils.getNowDate());
        return examDetailMapper.insertExamDetail(examDetail);
    }

    /**
     * 修改答题详情
     * 
     * @param examDetail 答题详情
     * @return 结果
     */
    @Override
    public int updateExamDetail(ExamDetail examDetail)
    {
        return examDetailMapper.updateExamDetail(examDetail);
    }

    /**
     * 批量删除答题详情
     * 
     * @param ids 需要删除的答题详情主键
     * @return 结果
     */
    @Override
    public int deleteExamDetailByIds(Long[] ids)
    {
        return examDetailMapper.deleteExamDetailByIds(ids);
    }

    /**
     * 删除答题详情信息
     * 
     * @param id 答题详情主键
     * @return 结果
     */
    @Override
    public int deleteExamDetailById(Long id)
    {
        return examDetailMapper.deleteExamDetailById(id);
    }
}